refactor: Standardize Arbitrage Contracts, Scripts, and Tests with Dependency Updates #143
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a comprehensive refactor of the arbitrage system, improving maintainability, standardizing naming conventions, and modernizing dependencies across contracts, scripts, and tests. The work consolidates the arbitrage contract under the new
Arbitrageidentifier, enhances compatibility with external libraries, and streamlines integration with Chainlink and Uniswap.Changes
🔑 Core Contracts
FlashArbitrageV2.solSafeERC20usage.safeTransfer/safeApprovewith directtransfer/approvefor simplicity and consistency.EmergencyWithdrawalevent for transparency when funds are withdrawn.FlashArbitrageV3.solSafeERC20usage, switching to direct transfers.@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.solfor broader compatibility.ArbitrageParamsV3struct to encapsulate advanced execution parameters.maxGasPrice,dynamicProfitMultiplier, and flexible profit sharing.safeTransfer/safeApprovewithtransfer/approveconsistently across profit distribution and swap logic.🏗 Deployment & Scripts
DeployArbitrage.s.solFlashArbitrage→Arbitrage.setUp()variable naming (modeConfig→SepoliaConfig).Arbitrageinstance for clarity.Swap.s.solArbitrage.@openzeppelin/contracts).PriceManipulation.s.sol🧪 Tests
ArbitrageTest.t.solArbitrageinstead ofFlashArbitrage.PriceManipulationTest.t.sol⚙️ Project Configuration
.gitmoduleschainlink-brownie-contractsas a new submodule dependency.foundry.lockchainlink-brownie-contractsat1.3.0.foundry.toml@chainlink/contracts..vscode/settings.jsonv0.8.18+commit.87f61d96for developer consistency.Motivation
Arbitragecontract name.SafeERC20usage, simplifying the codebase while maintaining security.Next Steps
transfervsSafeERC20in practice.maxGasPriceanddynamicProfitMultiplier.